<template>
  <div>
    <Title :title="'感知数量趋势'"/>
    <header>
      <img src="[publicPath]static/images/road/icon_che.png" alt="">
      <span>路口形状</span>
      <b>{{ dataList.junctionType }}</b>
    </header>
    <div class="box">
      <div class="box1">
        <div class="boxItem">
          <strong>{{ dataList.indexConnect }}</strong>
          <p><span>连通度</span><el-tooltip class="item" effect="dark" content="连通度" placement="top"><i>?</i></el-tooltip></p>
        </div>
        <div class="boxItem">
          <strong>{{ dataList.leftDelayTime }}</strong>
          <p><span>左转延误时间</span><el-tooltip class="item" effect="dark" content="左转延误时间" placement="top"><i>?</i></el-tooltip></p>
        </div>
        <div class="boxItem">
          <strong>{{ dataList.rightDelayTime }}</strong>
          <p><span>右转延误时间</span><el-tooltip class="item" effect="dark" content="右转延误时间" placement="top"><i>?</i></el-tooltip></p>
        </div>
      </div>
      <div class="box2">
        <div class="boxItem">
          <strong>{{ dataList.indexRankDiff }}</strong>
          <p><span>位阶差</span><el-tooltip class="item" effect="dark" content="位阶差" placement="top"><i>?</i></el-tooltip></p>
        </div>
        
        <div class="boxItem">
          <img src="[publicPath]static/images/road/img_lukou.png" alt="">
        </div>
      </div>
      <div class="box3">
        <div class="boxItem">
          <strong>{{ dataList.indexOutMatch }}</strong>
          <p><span>出入口配度</span><el-tooltip class="item" effect="dark" content="出入口配度" placement="top"><i>?</i></el-tooltip></p>
        </div>
        <div class="boxItem">
          <strong>{{ dataList.leftDelayIndex }}</strong>
          <p><span>左转延误指数</span><el-tooltip class="item" effect="dark" content="左转延误指数" placement="top"><i>?</i></el-tooltip></p>
        </div>
        <div class="boxItem">
          <strong>{{ dataList.rightDelayIndex }}</strong>
          <p><span>右转延误指数</span><el-tooltip class="item" effect="dark" content="右转延误指数" placement="top"><i>?</i></el-tooltip></p>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive, toRefs, computed, onMounted, watch } from 'vue';
import EcResize from '@sutpc/vue3-ec-resize';
import Title from './title.vue'
import { useUserStore } from '@/store/user';
// import { xiaoche } from '@/assets/images/imagesIn'
import { getJunctionIndexInfo } from '../../../utils/apiComponent'

export default defineComponent({
  name: 'ComponentOne',
  components: {
    Title,
    EcResize
  },
  setup() {
    const data = reactive({
      dataList: {
        junctionType: 'T',
        "indexConnect": null,
        "indexRankDiff": null,
        "indexOutMatch": null,
        "leftDelayTime": "0.00",
        "leftDelayIndex": "0.00",
        "rightDelayTime": "0.00",
        "rightDelayIndex": "0.00"
      }
    })
    const initData = () => {
      getJunctionIndexInfo().then((res) => {
        console.log(res)
        data.dataList = res
      })
    }
    onMounted(() => {
      initData()
    })
    const refData = toRefs(data)
    return {
      ...refData,
    }
  }
})
</script>

<style lang="less" scoped>
header{
  width: 100%;;
  height: 76px;
  background: linear-gradient( 219deg, rgba(37,177,255,0.1) 0%, #135377 100%);
  box-shadow: 0px 1px 14px 1px rgba(0,0,0,0.04), inset 0px 0px 35px 1px rgba(41,76,179,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;;
  margin-bottom: 20px;
  img{
    width: 85px;
    height: 75px;;
    margin-left: 20px;
    margin-right: 30px;
  }
  span{
    flex:1;
  }
  b{
    font-size: 18px;
    color: rgba(238,253,255,0.6);
    margin-right: 20px;
  }
}
.box{
  width: 100%;
  display: flex;
  justify-content: space-between;
  .boxItem{
    margin-bottom: 20px;;
    img{
      width: 200px;
      height: 160px;;
    }
    span{
      font-size: 24px;;
    }
    b{
      font-size: 12px;
      color: rgba(238,253,255,0.6);
    }
  }
  i{
    width: 18px;
    height: 18px;
    display: block;
    color: #fff;;
    border: 1px solid #fff;
    border-radius: 50%;
    font-size: 10px;
    text-align: center;
    line-height: 18px;;
    margin-left: 5px;
  }
  strong{
    font-size: 24px;
    color: rgba(0, 246, 253, 1)
  }
  p{
    display: flex;
    justify-content: flex-start;
    align-items: center;;
  }
  span{
    font-size: 18px;;
  }
  .box1{

  }
}
</style>